package com.syys.batch.config;

import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableBatchProcessing
public class StudentConfiguration {

    @Autowired
    private JobBuilderFactory jobBuilderFactory;

    @Autowired
    private StepBuilderFactory stepBuilderFactory;

//    @Autowired
//    private StudentProcessor studentProcessor;
//
//    @Bean
//    public Job studentJob() {
//        return jobBuilderFactory.get("studentJob")
//                .start(studentStep())
//                .build();
//    }
//
//    @Bean
//    public Step studentStep() {
//        return stepBuilderFactory.get("studentStep")
//                .<People, Student>chunk(10)
//                .reader(peopleCommonFileItemReader())
//                .processor(studentProcessor)
//                .writer(studentCommonFileItemWriter())
//                .build();
//    }
//
//    @Bean
//    @StepScope
//    public CommonFileItemReader<People> peopleCommonFileItemReader() {
//        return new CommonFileItemReader<>(People.class);
//    }
//
//
//    public CommonFileItemWriter<Student> studentCommonFileItemWriter() {
//        return new CommonFileItemWriter<>(Student.class);
//    }

}
